"use client";
import React from 'react';
import {usePathname, useSearchParams} from "next/navigation";
import {IoClose} from "react-icons/io5";
import Link from "next/link";
import Image from "next/image";

const Contact = () => {
    const searchParams = useSearchParams();
    const contactModal = searchParams.get("contact");
    const pathname = usePathname();

    return (
        <>
            {contactModal &&
              <div className="fixed left-0 top-0 w-full h-full bg-black bg-opacity-50 z-50 overflow-auto backdrop-blur flex justify-center items-center">
                  <div className="bg-white m-auto p-4 relative">
                      <Image src="/images/erweima.jpg" alt={"微信二维码"} width={300} height={900}/>
                      <Link href={pathname} className="absolute top-1 right-1">
                          <IoClose className="text-2xl cursor-pointer" />
                      </Link>
                  </div>
              </div>
            }
        </>
    );
};

export default Contact;